package org.light.framework.service;

import org.light.framework.bean.OperateResult;
import org.light.framework.bean.PageArgs;
import org.light.framework.bean.ResultColumn;
import org.light.framework.bean.ResultOrder;
import org.light.framework.bean.SearchArgs;
import org.light.framework.orm.DataTable;

/**
 * 业务组件基接口
 * @author de.cel
 *
 */
public interface IService {

	/**
	 * 批量删除
	 * @param ids
	 * @return
	 */
	OperateResult delete(Class<?> cls,String... ids);

	/**
	 * 求总记录数
	 * 
	 * @param tableOrViewName
	 * @param args
	 * @return
	 */
	int count(String tableOrViewName, SearchArgs args);

	/**
	 * 汇总求和
	 * 
	 * @param tableOrViewName
	 * @param columnName
	 * @param args
	 * @return
	 */
	Double sum(String tableOrViewName, String columnName, SearchArgs args);
	
	/**
	 * 查询表或视图
	 * 
	 * @param tableOrViewName
	 * @param searchArgs
	 * @param resultOrder
	 * @return
	 */
	DataTable getAll(String tableOrViewName, SearchArgs searchArgs, ResultOrder resultOrder);


	/**
	 * 查询表或视图
	 * 
	 * @param tableOrViewName
	 * @param searchArgs
	 * @param resultOrder
	 * @param resultColumn 结果列
	 * @return
	 */
	DataTable getAll(String tableOrViewName, SearchArgs searchArgs, ResultOrder resultOrder,ResultColumn resultColumn);

	/**
	 * 分页查询表或视图
	 * 
	 * @param tableOrViewName
	 * @param searchArgs
	 * @param pageArgs
	 * @param resultOrder
	 * @return
	 */
	DataTable search(String tableOrViewName, SearchArgs searchArgs, PageArgs pageArgs, ResultOrder resultOrder);
	
	/**
	 * 分页查询表或视图
	 * 
	 * @param tableOrViewName
	 * @param searchArgs
	 * @param pageArgs
	 * @param resultOrder
	 * @param resultColumn
	 * @return
	 */
	DataTable search(String tableOrViewName, SearchArgs searchArgs, PageArgs pageArgs, ResultOrder resultOrder,ResultColumn resultColumn);
}
